package com.horse.cloud.boss.feignclients;

import com.horse.cloud.data.domain.gateway.BusinessSystemBo;
import com.horse.cloud.data.domain.gateway.BusinessSystemQueryBo;
import com.horse.cloud.data.domain.gateway.GatewayServerQueryBo;
import com.horse.cloud.framework.base.BaseFeignClient;
import com.horse.cloud.framework.general.response.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @create : Created by intelliJ IDEA 17.2
 * @author : bing.Pan
 * @e-mail : 15923508369@163.com
 * @gmdate : 10 23 2017 16:19
 * @sidesc : feign 客户端调用类
 */

@FeignClient(name = "cloud-gateway",configuration = FeignLogConfiguration.class,fallbackFactory = GatewayFallBackFactory.class)
public interface GatewayClient extends BaseFeignClient {


    /**
     * 根据数据库主键查询业务系统记录
     * @param id   数据库主键
     * @return
     */
    @RequestMapping(value = "/foreign/gateway/findBussinessSystemById",method = RequestMethod.POST)
    Response findBussinessSystemById(@RequestParam("id") String id);


    /**
     * 根据时候存在数据库主键新增或修改业务系统
     * @param businessSystemBo
     * @return
     */
    @RequestMapping(value = "/foreign/gateway/addAndUpdate", method = RequestMethod.POST)
    Response addAndUpdate(@RequestBody BusinessSystemBo businessSystemBo);


    /**
     * 根据数据库主键删除业务系统记录
     * @param id
     * @return
     */
    @RequestMapping(value = "/foreign/gateway/deleteBusinessSystem", method = RequestMethod.POST)
    Response deleteBusinessSystem(@RequestParam("id") String id);

    /**
     * 根据条件查询服务网关业务系统列表
     * @param businessSystemQueryBo
     * @return
     */
    @RequestMapping(value = "/foreign/gateway/businessSystemList",method = RequestMethod.POST)
    Response businessSystemList(@RequestBody BusinessSystemQueryBo businessSystemQueryBo);



    /**
     * 根据条件查询服务网接口列表
     * @param gatewayServerQueryBo
     * @return
     */
    @RequestMapping(value = "/foreign/gateway/serverList",method = RequestMethod.POST)
    Response serverList(@RequestBody GatewayServerQueryBo gatewayServerQueryBo);



}
